package com.my.r2dbc.repositories;

import com.my.r2dbc.entity.Movie;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;

import java.util.Collection;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/2/19 15:50
 */
@Repository
public interface MovieRepositories extends ReactiveCrudRepository<Movie, Long> {
    
    // 默认继承了一堆CRUD方法；像mybatis-plus
    
    
    Flux<Movie> findAllByIdInAndNameLike(Collection<Long> id, String name);
    
    
    @Query("select * from movie") // 自定义Query注解，指定sql语句
    Flux<Movie> findHaha();
    
}
